import request from '@/utils/request'

// 查询预约看房列表
export function listAppointment(query) {
  return request({
    url: '/domain/appointment/list',
    method: 'get',
    params: query
  })
}

// 查询预约看房详细
export function getAppointment(appointmentId) {
  return request({
    url: '/domain/appointment/' + appointmentId,
    method: 'get'
  })
}

// 查询预约看房用户和房屋详细信息
export function getAppointmentOthers(userId, houseId) {
  return request({
    url: '/domain/appointment/' + userId + "/" + houseId,
    method: 'get'
  })
}

// 新增预约看房
export function addAppointment(data) {
  return request({
    url: '/domain/appointment',
    method: 'post',
    data: data
  })
}

// 修改预约看房
export function updateAppointment(data) {
  return request({
    url: '/domain/appointment',
    method: 'put',
    data: data
  })
}
// 中介处理预约看房
export function handleAppointment(data) {
  return request({
    url: '/domain/appointment/handle',
    method: 'put',
    data: data
  })
}

// 删除预约看房
export function delAppointment(appointmentId) {
  return request({
    url: '/domain/appointment/' + appointmentId,
    method: 'delete'
  })
}
